package metu.tespit.session.util;

/**
 * Created with IntelliJ IDEA.
 * User: ekisa
 * Date: 08.06.2012
 * Time: 09:25
 * To change this template use File | Settings | File Templates.
 */
import java.io.Serializable;
import java.util.Date;

import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Logger;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.async.QuartzTriggerHandle;
import org.jboss.seam.log.Log;

@Name("scheduledJobController")
@AutoCreate
public class ScheduledJobController implements Serializable {

    private static final long serialVersionUID = 7609983147081676186L;

    @In JobNotificationEmailsDueDateClose jobNotificationEmailsDueDateClose;
    @In JobNotificationEmailsDueDateOver jobNotificationEmailsDueDateOver;
    @In JobNotificationEmailsIncompleteActivity jobNotificationEmailsIncompleteActivity;

    @Logger
    Log log;

    private QuartzTriggerHandle quartzTestTriggerHandle;

    public void scheduleTimer() {
    	jobNotificationEmailsDueDateClose.createJobNotificationEmailsDueDateClose(new Date(), JobNotificationEmailsDueDateClose.getCronInterval());
    	jobNotificationEmailsDueDateOver.createJobNotificationEmailsDueDateOver(new Date(), JobNotificationEmailsDueDateOver.getCronInterval());
    	jobNotificationEmailsIncompleteActivity.createJobNotificationEmailsIncompleteActivity(new Date(), JobNotificationEmailsIncompleteActivity.getCronInterval());
    }
}
